﻿using Entity.Service;
using System.Configuration;

namespace Services
{
    public abstract class IAgentPayment
    {
        /// <summary>
        ///  获取用户信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public virtual ResultModel QueryUserInfo(dynamic agent)
        {
            return new ResultModel(ResultType.Error);
        }

        /// <summary>
        /// 支付
        /// </summary>
        /// <param name="agent"></param>
        /// <returns></returns>
        public virtual ResultModel Pay(dynamic agent)
        {
            return new ResultModel(ResultType.Error);
        }

        /// <summary>
        /// 冲正
        /// </summary>
        /// <param name="bankWaterNum"></param>
        /// <param name="orderWaterNum"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public virtual ResultModel Reversal(dynamic agent)
        {
            return new ResultModel(ResultType.Error);
        }

        /// <summary>
        /// 交易状态查询
        /// </summary>
        /// <param name="agent"></param>
        /// <returns></returns>
        public virtual ResultModel QueryOrder(dynamic agent)
        {
            return new ResultModel(ResultType.Error);
        }

        /// <summary>
        /// 获取代缴费服务实例
        /// </summary>
        /// <returns></returns>
        public static IAgentPayment GetAgentPaymentService()
        {
            IAgentPayment agent = null;
            string version = ConfigurationManager.AppSettings["version"].ToString();
            switch (version)
            {
                case "V35":
                    agent = new AgentPayment35();
                    break;
            }

            return agent;
        }
    }
}

